package org.ichow.utils
{
	
	/**
	 * ...
	 * @author Minos
	 */
	public class StringUtil
	{
		
		public function StringUtil()
		{
		}
		
		private static var alphabet : String = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY';
		
		public static function randomString( length : int ) : String
		{
			var result : String = "";
			while ( length-- )
			{
				result += alphabet.charAt( Math.floor( Math.random() * alphabet.length ) );
			}
			return result;
		}
		
		public static function getPath( url : String = "" , sign : String = "/" ) : String
		{
			return url.substring( 0 , url.lastIndexOf( sign ) + 1 );
		}
	
	}

}